package enumClass;

public class selfEnum {
    public static void main(String[] args) {
        Week week = Week.MON;
        System.out.println(week);
        System.out.println(week.getWeekTitle());
        System.out.println(week.getWeekDesc());
    }
}

class Week {

    // 定义枚举类的属性
    private final String WeekTitle;
    private final String WeekDesc;

    // 构造方法私有化
    private Week(String weekTitle, String weekDesc) {
        this.WeekTitle = weekTitle;
        this.WeekDesc = weekDesc;
    }

    // 定义枚举类的对象
    public static final Week MON = new Week("星期一", "周一");
    public static final Week TUE = new Week("星期二", "周二");
    public static final Week WED = new Week("星期三", "周三");
    public static final Week THU = new Week("星期四", "周四");
    public static final Week FRI = new Week("星期五", "周五");
    public static final Week SAT = new Week("星期六", "周六");
    public static final Week SUN = new Week("星期日", "周日");

    // 定义枚举类的方法
    public String getWeekTitle() {
        return WeekTitle;
    }

    public String getWeekDesc() {
        return WeekDesc;
    }

    // 重写toString方法
    @Override
    public String toString() {
        return WeekTitle;
    }
}
